package domain;

import java.io.File;
import java.io.IOException;
import java.net.ConnectException;
import java.nio.file.InvalidPathException;

/**
 *
 * @author Joachim
 */
public class DropboxController {

    private Client client;

    public DropboxController(Client client) {
        this.client = client;
    }

    public String getRootDirectory() {
        System.out.println(client.getRootDirectory());
        return client.getRootDirectory();
    }

    public void setRootDirectory(String url) {
        try {
            client.setRootDirectory(url);
        }
        catch(Exception e) {
            e.printStackTrace();
        }
    }

    public void synchronize() {
        new SynchronizeThread(client).start();
    }

    public void setDirectoryListener(boolean synched) throws ConnectException {
        client.setDirectoryListener(synched);
    }
}
